package models

import (
	"gorm.io/gorm"
)

type Userbasic struct {
	gorm.Model
	Name          string `json:"name" gorm:"type:varchar(50);not null;unique;comment:用户名"`
	Password      string `json:"password" gorm:"type:varchar(50);not null;comment:密码"`
	Phone         string `json:"phone" gorm:"type:varchar(20);not null;unique;comment:手机号"`
	Email         string `json:"email" gorm:"type:varchar(50);not null;unique;comment:邮箱"`
	Identity      string `json:"identity" gorm:"type:varchar(20);not null;comment:用户身份"`
	ClentIp       string `json:"client_ip" gorm:"type:varchar(20);not null;comment:客户端IP"`
	ClentPort     int    `json:"client_port" gorm:"type:int;not null;comment:客户端端口"`
	LoginTime     uint   `json:"login_time" gorm:"type:bigint;not null;comment:登录时间"`
	HeartbeatTime uint   `json:"heartbeat_time" gorm:"type:bigint;not null;comment:心跳时间"`
	LogOutTime    uint   `json:"logout_time" gorm:"type:bigint;not null;comment:登出时间"`
	IsLogOut      bool   `json:"is_logout" gorm:"type:bool;not null;default:false;comment:是否登出"`
	DeviceInfo    string `json:"device_info" gorm:"type:varchar(100);not null;comment:设备信息"`
}

func (Userbasic) TableName() string {
	return "user_basic"
}
